package com.example.SpringBoot_demo.service.impl;

import com.example.SpringBoot_demo.bean.LoginUser;
import com.example.SpringBoot_demo.mapper.LoginMapper;
import com.example.SpringBoot_demo.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements ILoginService {
    @Autowired
    private LoginMapper loginMapper;
    @Override
    public LoginUser loginById(String userId) {
        return loginMapper.loginById(userId);
    }

    @Override
    public LoginUser loginByName(String userName) {
        return loginMapper.loginByName(userName);
    }

    @Override
    public LoginUser getUserByEmail(String email) {
        return loginMapper.getUserByEmail(email);
    }

    @Override
    public void updateUserPassword(String email,String userName,String password, String password2) {
        loginMapper.updateUserPassword(email,userName,password,password2);
    }

    @Override
    public LoginUser login(String userName, String password) {
        return loginMapper.login(userName,password);
    }

    @Override
    public void registUser(String userId, String userName, String password, String password2, String userSex, String userPhone, String userAddress,String email) {
        loginMapper.registUser(userId,userName,password,password2,userSex,userPhone,userAddress,email);
    }
}
